package cn.iocoder.yudao.module.pay.mq.producer.order;

import cn.iocoder.yudao.module.pay.mq.message.PayOrderSuccessMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 订单支付 Producer
 */
@Slf4j
@Component
public class PayOrderProducer {

    @Resource
    private ApplicationContext applicationContext;

    /**
     * 发送 {@link PayOrderSuccessMessage} 消息
     *
     * @param message 订单支付支付成功消息
     */
    public void sendPayOrderSuccessMessage(PayOrderSuccessMessage message) {
        applicationContext.publishEvent(message);
    }

}
